﻿-- =============================================
-- Author:		Andreas Könighofer (IT-eXperience)
-- Create date: 14.01.2009
-- Description:	Inserts new rental service into RentalService table
-- =============================================
CREATE PROCEDURE [dbo].[CreateRentalService]
	-- Add the parameters for the stored procedure here
	@StartDate SMALLDATETIME
    , @EndDate SMALLDATETIME
    , @ResourceID INT
    , @CustomerID INT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	INSERT INTO [BigDays2009].[dbo].[RentalService]
    (
		[StartDate]
        ,[EndDate]
        ,[ResourceID]
        ,[CustomerID])
     VALUES
	 (
		@StartDate
        , @EndDate
        , @ResourceID
        , @CustomerID
    )
    RETURN SCOPE_IDENTITY()
END

---- end script CreateRentalService stored procedure ----

---- start script CreateWorker stored procedure ----

